﻿@using NewLife.Common
@{
    var set = NewLife.Cube.Setting.Current;
}
<div class="tab-pane fade in active" id="Login">
    <!-- Logo-->
    <div class="row text-center">
        <i class="glyphicon glyphicon-cloud login-logo center-block" style="display: inline-block;"></i>
        @*<span style="display: inline-block;vertical-align: 56px;margin-left: 10px;font-size: 24px;">@SysConfig.Current.DisplayName</span>*@
    </div>
    <!-- 登录-->
    @using (Html.BeginForm("Login", "User", new { r = ViewBag.ReturnUrl }, FormMethod.Post, new { @class = "cube-login" }))
    {
        if (ViewBag.IsShowTip)
        {
        <div class="alert alert-block alert-success">
            默认账号：<span class="orange">admin</span>；默认密码：<span class="orange">admin</span>
        </div>
        }
        @Html.ValidationSummary()
        <span class="heading text-primary"><a href="~/">@SysConfig.Current.DisplayName</a> 登录</span>
        if (set.AllowLogin)
        {
            <div class="form-group">
                <input type="text" class="form-control" id="username" name="username" placeholder="用户名 / 邮箱">
                <i class="glyphicon glyphicon-user"></i>
            </div>
            <div class="form-group">
                <input type="password" class="form-control" id="password" name="password" placeholder="密码">
                <i class="glyphicon glyphicon-lock"></i>
                @*<a href="#Forgot" data-toggle="tab" class="glyphicon glyphicon-question-sign"></a>*@
            </div>
            <div class="form-group">
                <div class="main-checkbox">
                    <input type="checkbox" value="true" id="remember" name="remember" />
                    <label for="remember"></label>
                </div>
                <label class="text text-primary" for="remember">记住我</label>
                @if (set.AllowRegister)
                {
                    @*<div class="toolbar clearfix text-center">
                        <div class="row" style="padding:30px 60px 0 60px;">*@
                    @*@if (true)
                        {
                            <a href="#Forgot" data-toggle="tab" style="float: left">
                                <i class="glyphicon glyphicon-info-sign"></i>
                                忘记密码？
                            </a>
                        }*@

                    if (set.AllowRegister)
                    {
                        <div style="display: inline-block; margin-top: 5px; float: right;">
                            @*<span style="margin-left: auto; margin-right: auto; margin-top: 5px;">没有账号？</span>*@
                            <a href="#Register" data-toggle="tab" style="margin-left: auto; margin-right: auto;position: static; font-size: 15px; margin-top: 5px;">
                                @*<i class="glyphicon glyphicon-menu-right"></i>*@
                                <span>我要注册</span>
                            </a>
                        </div>
                    }
                    @*</div>
                        </div>*@
                }
                <button type="submit" class="btn btn-default" style="margin: 5px 0 15px 0;width: 100%;">登录</button>
            </div>

            if (!set.LoginTip.IsNullOrEmpty())
            {
                <h4 class="header blue lighter bigger">
                    <i class="ace-icon fa fa-coffee green"></i>

                </h4>

                <div class="space-6"></div>

                <nav class="navbar navbar-fixed-top">
                    <div class="alert alert-warning alert-dismissible text-center" role="alert" style="margin-bottom:0px;">
                        <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        @Html.Raw(set.LoginTip)
                    </div>
                </nav>
            }
        }
    }
</div>